<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr = [{ name: "duyi" }];
      function add(_arr) {
        const obj = { name: "cst" };
        const newArr = JSON.parse(JSON.stringify(_arr));
        newArr.push(obj);
        return newArr;
      }

      console.log(add(arr), arr);
    </script>
  </body>
</html>
